#pragma once

#include "fxcc/core/graph/directX11/pch.h"
#include "fxcc/core/graph/directX11/MeshJack.h"
#include "fxcc/core/graph/directX11/Shader.h"
#include "fxcc/core/graph/directX11/UploadBuffer.h"

#include "mustache.hpp"

namespace fxcc
{
	namespace graph
	{
		namespace directX11
		{
			struct FXCC_API Effect3d :public fxcc::graph::common::Effect3d
			{
				std::shared_ptr<fxcc::graph::directX11::Shader> m_Shader, m_AnimShader;

				std::shared_ptr<fxcc::graph::directX11::UploadBuffer> m_PassBuffer, m_ObjBuffer, m_BoneBuffer;

				Effect3d(const std::string& fragMainCode);

				void Begin();

				void SetCamera(const common::Camera& camera);

				void SetPassData(const PassData& passData);

				void SetObjData(const ObjData& objData);

				void SetBoneData(const BoneData& boneData);

				void InstMeshJack(const fxcc::graph::directX11::MeshJack* mesh);
				
				void InstSkinnedMeshJack(const fxcc::graph::directX11::MeshJack* mesh);

				void End();

				static std::string FixedVertCode();

				static std::string SkinnedVertCode();

				static std::string CommonCode();

				static std::string GetFragTemp();

				std::string m_FragMainCode;
				
				std::string GetFragCode();
			};
		}
	}
}